package com.liuyucheng.designpattern.观察者模式;

/**
 * 观察者1
 */
public class Ob1 extends Observer{

    private Subject subject;

    public Ob1(Subject subject) {
        this.subject = subject;
        subject.attach(this);
    }

    @Override
    public void notice() {
        System.out.println("ob1 receive notice:cash="+subject.getCash());
    }
}
